<template>
  <div class="section_common">
    <div class="main">
      <el-form ref="form"  label-width="100px">

        <el-form-item label="所属仓库" required>
          <el-radio-group v-model="area">
            <el-radio label="1">东莞仓</el-radio>
            <el-radio label="2">上雪仓</el-radio>
          </el-radio-group>

        </el-form-item>

        <el-form-item label="房号" required>
          <el-input v-model="room" size="mini"></el-input>
        </el-form-item>
        <el-form-item label="姓名" required>
          <el-input v-model="name" size="mini"></el-input>
        </el-form-item>

        <el-form-item label="性别" required>
          <el-radio v-model="sex" label="男">男</el-radio>
          <el-radio v-model="sex" label="女">女</el-radio>
        </el-form-item>

        <el-form-item label="部门/岗位" required>
          <el-input v-model="dept" size="mini"></el-input>
        </el-form-item>
        <el-form-item label="入住时间" required>
          <el-date-picker
            size="mini"
            v-model="intime"
            type="date"
            placeholder="选择日期"
            :editable="false"
            value-format="yyyy-MM-dd"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item>

        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>

export default {
  data() {
    return {
      id:"",
      area:"",
      room:"",
      mid:"",
      name:"",
      dept:"",
      intime:"",
      sex:"",
      minDate:new Date(new Date().getTime()-180*24*60*60*1000),
      msgcode:"",

      nowUser: '',
      title: "宿舍登记",

      date:"",
      exceptshow:false,
    };
  },
  created() {
    this.nowUser=JSON.parse(localStorage.getItem('userInfo')).userId;
    this.id= this.$route.params.id;
    this.getDormitoryInfo();
  },
  methods: {

    getDormitoryInfo(){
      this.$https.post('/mobiles/getDormitoryInfo',{
        nowUser:this.nowUser,
        id:this.id
      }).then((res)=>{
debugger
        this.area=res.data.data.area;
        this.room=res.data.data.room;
        this.name=res.data.data.name;
        this.dept=res.data.data.dept;
        this.sex=res.data.data.sex;
        this.intime=res.data.data.intime;

      }).catch(err => {
        console.log(err);
      })
    },
    // 返回
    goBack() {
      this.$router.go(-1);
    },

  },
};
</script>

<style lang="scss" scoped>
.main {
  display: flex;
  justify-items: center;
  margin: 0 auto;
  .el-form {
    padding-right: 10px;
    .el-form-item {
      .el-form-item__label {
        line-height: 16px;
      }
      margin-bottom: 5px;
    }
  }
}
</style>